package com.lsy.jetpackdemo

import android.util.Log
import androidx.hilt.lifecycle.ViewModelInject
import androidx.lifecycle.ViewModel

/**
 * @Author Lsy
 * @Date 2022/10/12 9:32
 */
class ArticlesViewModel @ViewModelInject constructor(private val repository: Repository) : BaseViewModel() {
    var articleList = SingleLiveEvent<List<Article>>()

    fun getTopArticle() {
       launchUI {
            articleList.postValue(repository.getTopArticles().data)
        }
    }
}